package model;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public class TestClass {

	public static void main(String[] args) {
		EntityManagerFactory emf = Persistence
				.createEntityManagerFactory("Animals");
		EntityManager em = emf.createEntityManager();

		Cat cat1 = new Cat("Murzik", true, "Blue");
		Cat cat2 = new Cat("Matroskin", false, "Yellow");
		Cat cat3 = new Cat("Kuzya", true, "Green");
		Cat cat4 = new Cat("Barsik", true, "Black");
		Cat cat5 = new Cat("Bonifaciy", false, "Red");

		Dog dog1 = new Dog("Sharik", true);
		Dog dog2 = new Dog("Bobik", false);
		Dog dog3 = new Dog("Barbos", false);
		Dog dog4 = new Dog("Belka", true);
		Dog dog5 = new Dog("Strelka", true);

		em.getTransaction().begin();
		em.persist(cat1);
		em.persist(cat2);
		em.persist(cat3);
		em.persist(cat4);
		em.persist(cat5);
		em.persist(dog1);
		em.persist(dog2);
		em.persist(dog3);
		em.persist(dog4);
		em.persist(dog5);
		em.getTransaction().commit();

	}

}
